home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kparts / mainwindow.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  3.1 KB  |  108 lines

  1. /* This file is part of the KDE project
  2.    Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
  3.              (C) 1999 David Faure <faure@kde.org>
  4.  
  5.    This library is free software; you can redistribute it and/or
  6.    modify it under the terms of the GNU Library General Public
  7.    License as published by the Free Software Foundation; either
  8.    version 2 of the License, or (at your option) any later version.
  9.  
  10.    This library is distributed in the hope that it will be useful,
  11.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.    Library General Public License for more details.
  14.  
  15.    You should have received a copy of the GNU Library General Public License
  16.    along with this library; see the file COPYING.LIB.  If not, write to
  17.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18.    Boston, MA 02110-1301, USA.
  19. */
  20. #ifndef __MAINWINDOW_H
  21. #define __MAINWINDOW_H
  22.  
  23. #include <qptrlist.h>
  24. #include <kaction.h>
  25.  
  26. #include <kmainwindow.h>
  27.  
  28. #include <kparts/part.h>
  29.  
  30. class QString;
  31.  
  32. namespace KParts
  33. {
  34.  
  35. class MainWindowPrivate;
  36.  
  37. /**
  38.  * A KPart-aware main window, whose user interface is described in XML.
  39.  *
  40.  * Inherit your main window from this class
  41.  * and don't forget to call setXMLFile() in the inherited constructor.
  42.  *
  43.  * It implements all internal interfaces in the case of a
  44.  * KMainWindow as host: the builder and servant interface (for menu
  45.  * merging).
  46.  */
  47. class KPARTS_EXPORT MainWindow : public KMainWindow, virtual public PartBase
  48. {
  49.   Q_OBJECT
  50.  public:
  51.   /**
  52.    * Constructor, same signature as KMainWindow.
  53.    */
  54.   MainWindow( QWidget* parent,  const char *name = 0L, WFlags f = WType_TopLevel | WDestructiveClose );
  55.   /**
  56.    * Compatibility Constructor
  57.    */
  58.   MainWindow( const char *name = 0L, WFlags f = WDestructiveClose );
  59.   /**
  60.    * Constructor with creation flags, see KMainWindow.
  61.    * @since 3.2
  62.    */
  63.   MainWindow( int cflags, QWidget* parent,  const char *name = 0L, WFlags f = WType_TopLevel | WDestructiveClose );
  64.   /**
  65.    * Destructor.
  66.    */
  67.   virtual ~MainWindow();
  68.  
  69. protected slots:
  70.  
  71.   /**
  72.    * Create the GUI (by merging the host's and the active part's)
  73.    * You _must_ call this in order to see any GUI being created.
  74.    *
  75.    * In a main window with multiple parts being shown (e.g. as in Konqueror)
  76.    * you need to connect this slot to the
  77.    * KPartManager::activePartChanged() signal
  78.    *
  79.    * @param part The active part (set to 0L if no part).
  80.    */
  81.   void createGUI( KParts::Part * part );
  82.  
  83.   /**
  84.    * Called when the active part wants to change the statusbar message
  85.    * Reimplement if your mainwindow has a complex statusbar
  86.    * (with several items)
  87.    */
  88.   virtual void slotSetStatusBarText( const QString & );
  89.  
  90.   /**
  91.    * Rebuilds the GUI after KEditToolbar changed the toolbar layout.
  92.    * @see configureToolbars()
  93.    * KDE4: make this virtual. (For now we rely on the fact that it's called
  94.    * as a slot, so the metaobject finds it here).
  95.    */
  96.   void saveNewToolbarConfig();
  97.  
  98. protected:
  99.   virtual void createShellGUI( bool create = true );
  100.  
  101. private:
  102.   MainWindowPrivate *d;
  103. };
  104.  
  105. }
  106.  
  107. #endif
  108.